-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add actor testcontainer tests #1192
base: master
Are you sure you want to change the base?
Conversation
@salaboy I have currently the problem that the test fails with the following exception when trying to connect to the Dapr gRPC port.
Not sure why it uses port 50001, because this is the internal port. I think normally it should use the mapped port. Maybe you can have a look, if the test is not correct configured? |
@akkie thanks a lot of this.. give me some time to look into this.. check the DCO, we need that to approve the PR. Click on the Details link to see the steps to fix it. |
@salaboy Is it OK if I do a force push regarding the update of the DCO? |
@akkie yeah.. that is your fork.. so it is ok |
ee83cff
to
bec4bd2
Compare
@akkie would you mind adding me as a collaborator to your fork? I am working on a fix, but I would love to push to your fork.. if not I can send you a patch to apply to your fork with the fix |
Done |
@akkie I will push two commits to your fork, I am stuck with a new error now.. but at least the connection is working now. |
Now I am stuck with this:
But the connection is working as far as I can tell. |
This is strange.. because it looks like we are hitting this: dapr/dapr#6783 @artursouza do you know if these examples are executed as part of the tests? |
@salaboy This is exactly the message we get with our testcontainer setup:
We use .NET and not Java. |
Ok so I think we are up to something here
- Blog: http://salaboy.com <http://salaboy.wordpress.com>
- Github user: http://github.com/salaboy
- Twitter: http://twitter.com/salaboy
- Mauricio "Salaboy" Salatino -
…On Wed, 22 Jan 2025 at 20:11, Christian Kaps ***@***.***> wrote:
@salaboy <https://github.com/salaboy> This is exactly the message we get
with our testcontainer setup:
´´´
fails to send binding event to http app channel, status code: 500 body:
Dapr.DaprApiException: error invoke actor method: did not find address for
actor
´´´
We use .NET and not Java.
—
Reply to this email directly, view it on GitHub
<#1192 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCMXUKSIIUSSF7NQM2YJT2L73O5AVCNFSM6AAAAABVI4UL56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYGE3TANRUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@akkie I am curious.. are you testing with an in-memory statestore? |
@salaboy Yes, we are using Redis. |
@akkie if you pull the code that I push can you check that you are getting the same results? |
@salaboy You mean running the tests? If I run them, yes, I get the same result:
|
@akkie good news.. i think that I found the issue..
I will try to fix this and push again. |
@salaboy Any news regarding the issue? |
I am still fighting with this.. for some
Reason after fixing all the connection issues, the actor is not registered
in the placement service. I am trying to figure out why
- Blog: http://salaboy.com <http://salaboy.wordpress.com>
- Github user: http://github.com/salaboy
- Twitter: http://twitter.com/salaboy
- Mauricio "Salaboy" Salatino -
…On Thu, 30 Jan 2025 at 10:12, Christian Kaps ***@***.***> wrote:
@salaboy <https://github.com/salaboy> Any news regarding the issue?
—
Reply to this email directly, view it on GitHub
<#1192 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCMXUL5XKLZCHGK7LKWE32NH3JFAVCNFSM6AAAAABVI4UL56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRUGA2TQNZRGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The funny thing is that the actor example in the Java SDK is working , but
that example uses two sidecars instead of one.. and I am not entirely sure
if that placement service is configured differently
- Blog: http://salaboy.com <http://salaboy.wordpress.com>
- Github user: http://github.com/salaboy
- Twitter: http://twitter.com/salaboy
- Mauricio "Salaboy" Salatino -
…On Thu, 30 Jan 2025 at 10:59, Mauricio Salatino ***@***.***> wrote:
I am still fighting with this.. for some
Reason after fixing all the connection issues, the actor is not registered
in the placement service. I am trying to figure out why
- Blog: http://salaboy.com <http://salaboy.wordpress.com>
- Github user: http://github.com/salaboy
- Twitter: http://twitter.com/salaboy
- Mauricio "Salaboy" Salatino -
On Thu, 30 Jan 2025 at 10:12, Christian Kaps ***@***.***>
wrote:
> @salaboy <https://github.com/salaboy> Any news regarding the issue?
>
> —
> Reply to this email directly, view it on GitHub
> <#1192 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACCMXUL5XKLZCHGK7LKWE32NH3JFAVCNFSM6AAAAABVI4UL56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRUGA2TQNZRGY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
@salaboy and @akkie I have found what's the culprit. Please check #1202. The TL;DR is that I will try to have a quick fix just to unblock this PR, but in general I think CC: @artursouza @cicoyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdk-tests/src/test/java/io/dapr/it/testcontainers/TestDaprActorsConfiguration.java
Show resolved
Hide resolved
@artur-ciocanu Thanks for working on that. I fixed the formatting issues. Is there anything I need to do to get the tests running locally? They still failing for me with the message: api error: code = Internal desc = error invoke actor method: did not find address for actor TestActor/789215ad-9328-4019-8c86-6a4b6cc664a7 |
@akkie I think we are hitting the same issue as we hit with PubSub.. we need to investigate this further.. My expectation is that if we run this application in a Kubernetes Cluster, everything works.. so the issue is related with the sequence in which both the app and the sidecar gets bootstrapped by testcontainers. |
@akkie also I think you need to take care of the DCO |
I've created this PR to make sure that I can trigger the pipelines.. but it should contain exactly the same changes as this one: #1204 check the comment about PubSub there. |
8e0f635
to
ef9b2fc
Compare
Damn. I have fixed it. |
@akkie @artur-ciocanu Ok.. i found the issue that was also causing the PubSub IT test to fail, thanks to @artursouza to point me to the --app-health-checks flag https://github.com/dapr/java-sdk/pull/1192/files#diff-48e3bf69571df5def11599cd5a3f3dfdbdfe292ead052f95a47a3a1939db5845R254 The problem now, is that we need to wait before starting the tests, as Dapr needs to wait for the app to be healthy to start receiving operations. There should be a more gracious way to wait. I tried with DaprClient.waitForSideCar(), but I don't think that works as expected either. If you debug the test, you will see that while the test is sleeping Dapr is finishing the bootstrap, but now at least Dapr pings back the application to check it's health before moving forward with the bootstrap. |
@akkie I am not sure why this complains about the DCO when I sign my commits.. Can you pull the changes that I pushed to your fork and resign? |
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]> Signed-off-by: Christian Kaps <[email protected]>
…r#1201) Signed-off-by: Christian Kaps <[email protected]>
…rs module (dapr#1210) * feat: Adding basic HTTPEndpoint configuration support in testcontainers module Signed-off-by: Laurent Broudoux <[email protected]> * feat: dapr#1209 Adding test for HTTPEndpoint in testcontainers module Signed-off-by: Laurent Broudoux <[email protected]> --------- Signed-off-by: Laurent Broudoux <[email protected]> Signed-off-by: Christian Kaps <[email protected]>
Signed-off-by: Christian Kaps <[email protected]>
fe76f18
to
b27e75b
Compare
Done |
@akkie if you were trying to do this in dotnet.. I think we found the solution.. do you think that you can give that a try? With @artur-ciocanu we will make sure to merge this tests in the Java SDK |
Thanks @salaboy and everyone else involved for your help to resolve this issue. Sure, I will try to also fix that in our code. If I understand that correctly, then the only thing I need to do is to call https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-client/#wait-for-sidecar |
@akkie that didn't worked for me.. there are a few important things here:
|
@akkie and @salaboy I wanted to share a few observations, it is related to my other PR #1213. With @artursouza and @salaboy help here is what we know:
To avoid the race condition one option is to use a "dumb" @Test
public void testActors() {
Wait.forLogMessage(".*Actor runtime started.*", 1)
.waitUntilReady(DAPR_CONTAINER);
....
} This will ensure that the test will start ONLY when actor runtime is properly started. It is still not the best user experience, I would like to hide it somewhere, but it is at least inline with Testcontainers and leveraging its capabilities. A better option would be to move the |
Description
This PR adds testcontainer based integration tests for actors. This is to make sure that actors really work with testcontainers.
Issue reference
This PR was crated based on a Discord discussion with @salaboy to check if actors works with testcontainers.